{% for topic in topics %}
    <div class="media topic">
        <div class="media-left">
            <a href="{{ path('user_view', {'username': topic.user.username}) }}">
                <img src="{{ asset(topic.user.avatar)|imagine_filter('middle_square') }}" class="media-object avatar" role="avatar">
            </a>
        </div>
        <div class="media-body">
            <div class="media-heading title">
                <a href="{{ path('topic_view', {'id': topic.id}) }}">{{ topic.title }}</a>
                {% if topic.recommended %}
                    <i class="if i-badge"></i>
                {% endif %}
            </div>
            <ul class="list-unstyled list-inline meta">
                <li>{{ topic.user.username }} 发起于 {{ topic.createdAt|time_diff }}</li>
                <li>最后回复：{{ topic.repliedAt|time_diff }}</li>
                <li>
                    {% include 'PHPDishWebBundle:Thread:thread_tagify.html.twig' with {'threads': topic.threads} %}
                </li>
            </ul>
        </div>
    </div>
    {% if not loop.last %}
        <hr class="margin-vertical-10"/>
    {% endif %}
{% else %}
    <div class="empty-data">
        <i class="if i-comment"></i> 没有话题
    </div>
{% endfor %}